var status = -1;

function action(f, d, c) {
    var b = cm.getEventManager("BeidlerPQ");
    var a = cm.getEventInstance();
    if (b != null && a != null) {
        var e = a.getProperty("BeidlerHead");
        if (a.getProperty("Check").equals("1")) {
            a.setProperty("Check", "2");
            cm.gainMembersPQ("贝勒?德", 1)
        }
        if (e.equals("11")) {
            cm.getPlayer().showPortal("phase2-1", "2");
            cm.getPlayer().showPortal("phase2-2", "2")
        } else {
            if (e.equals("111")) {
                cm.getPlayer().showPortal("phase2-1", "2");
                cm.getPlayer().showPortal("phase2-2", "2");
                cm.getPlayer().showPortal("phase3", "2")
            }
        }
        cm.getPlayer().gaintBossMap();
        cm.getPlayer().sendDathCount()
    }
    cm.dispose()
}

function start() {
    status = -1;
    action(1, 0, 0)
};